#!/bin/bash
/bin/launchctl unload /System/Library/LaunchDaemons/com.bigboss.sbsettingsd.plist

rm /var/mobile/Library/SBSettings/Toggles/AdBlock/AdBlock.pid
cp /var/mobile/Library/SBSettings/Toggles/AdBlock/AdBlockOff_hosts /etc/hosts

if [ -f /System/Library/PrivateFrameworks/WebCore.framework/missingImage.png ]
then
	rm /System/Library/PrivateFrameworks/WebCore.framework/missingImage.png
fi

cp /var/mobile/Library/SBSettings/Toggles/AdBlock/missingImage.orig /System/Library/PrivateFrameworks/WebCore.framework/missingImage.png


declare -a cydia
cydia=($CYDIA)

if [[ $1 == remove ]]; then
    if [[ ${CYDIA+@} ]]; then
        eval "echo 'finish:restart' >&${cydia[0]}"
    fi
fi
exit 0
 
